package com.slz3.business.module.wmsManagement.wmsTraysManage.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.wmsManagement.wmsTraysManage.domain.WmsTraysManage;
import com.slz3.business.module.wmsManagement.wmsTraysManage.domain.WmsTraysManageCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import java.util.ArrayList;
import java.util.List;

public class WmsTraysManageResController extends WmsTraysManageResAtomic {

    public Mono<ServerResponse> add(ServerRequest req, WmsTraysManage wmsTraysManage) {
        if (WmsTraysManageResUnsafeValid.add(req, wmsTraysManage)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.add_$WmsTraysManageUpdateLock(req, wmsTraysManage);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, WmsTraysManageCondition wmsTraysManageCondition) {
        if (WmsTraysManageResUnsafeValid.delete(req, wmsTraysManageCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.delete_$WmsTraysManageUpdateLock(req, wmsTraysManageCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, WmsTraysManage wmsTraysManage) {
        if (WmsTraysManageResUnsafeValid.modify(req, wmsTraysManage)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.modify_$WmsTraysManageUpdateLock(req, wmsTraysManage);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (WmsTraysManageResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return wmsTraysManageResAtomic.info_$WmsTraysManageUpdateLock(req);
        if (WmsTraysManageResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.info_$WmsTraysManageUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (WmsTraysManageResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.choice(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, WmsTraysManageCondition wmsTraysManageCondition) {
        //
        if (WmsTraysManageResUnsafeValid.auditSubmit(req, wmsTraysManageCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditSubmit_$WmsTraysManageUpdateLock(req, wmsTraysManageCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, WmsTraysManageCondition wmsTraysManageCondition) {
        if (WmsTraysManageResUnsafeValid.audit(req, wmsTraysManageCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.audit_$WmsTraysManageUpdateLock(req, wmsTraysManageCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, WmsTraysManageCondition wmsTraysManageCondition) {
        if (WmsTraysManageResUnsafeValid.auditReject(req, wmsTraysManageCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditReject_$WmsTraysManageUpdateLock(req, wmsTraysManageCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, WmsTraysManageCondition wmsTraysManageCondition) {
        if (WmsTraysManageResUnsafeValid.usingEnable(req, wmsTraysManageCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingEnable_$WmsTraysManageUpdateLock(req, wmsTraysManageCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, WmsTraysManageCondition wmsTraysManageCondition) {
        if (WmsTraysManageResUnsafeValid.usingDisable(req, wmsTraysManageCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingDisable_$WmsTraysManageUpdateLock(req, wmsTraysManageCondition);
        }
    }

}
